home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / emula / arosdv19.lha / AROS / exec / adddevice.c < prev    next >
C/C++ Source or Header  |  1996-10-24  |  2KB  |  82 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: adddevice.c,v 1.5 1996/10/24 15:50:41 aros Exp $
  4.     $Log: adddevice.c,v $
  5.     Revision 1.5  1996/10/24 15:50:41  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.4  1996/08/13 13:55:55  digulla
  9.     Replaced AROS_LA by AROS_LHA
  10.     Replaced some AROS_LH*I by AROS_LH*
  11.     Sorted and added includes
  12.  
  13.     Revision 1.3  1996/08/01 17:41:01  digulla
  14.     Added standard header for all files
  15.  
  16.     Desc:
  17.     Lang: english
  18. */
  19. #include <exec/execbase.h>
  20. #include <exec/devices.h>
  21. #include <aros/libcall.h>
  22.  
  23. /*****************************************************************************
  24.  
  25.     NAME */
  26.     #include <clib/exec_protos.h>
  27.  
  28.     AROS_LH1(void, AddDevice,
  29.  
  30. /*  SYNOPSIS */
  31.     AROS_LHA(struct Device *, device,A1),
  32.  
  33. /*  LOCATION */
  34.     struct ExecBase *, SysBase, 72, Exec)
  35.  
  36. /*  FUNCTION
  37.     Adds a given device to the system's device list after checksumming
  38.     the device vectors. This function is not for general use but
  39.     (of course) for building devices that don't use exec's MakeLibrary()
  40.     mechanism.
  41.  
  42.     INPUTS
  43.     device - Pointer to a ready for use device structure.
  44.  
  45.     RESULT
  46.  
  47.     NOTES
  48.  
  49.     EXAMPLE
  50.  
  51.     BUGS
  52.  
  53.     SEE ALSO
  54.     RemDevice(), OpenDevice(), CloseDevice()
  55.  
  56.     INTERNALS
  57.  
  58.     HISTORY
  59.  
  60. ******************************************************************************/
  61. {
  62.     AROS_LIBFUNC_INIT
  63.  
  64.     /* Just in case the user forgot them */
  65.     device->dd_Library.lib_Node.ln_Type=NT_DEVICE;
  66.     device->dd_Library.lib_Flags|=LIBF_CHANGED;
  67.  
  68.     /* Build checksum for device vectors */
  69.     SumLibrary(&device->dd_Library);
  70.  
  71.     /* Arbitrate for the device list */
  72.     Forbid();
  73.  
  74.     /* And add the device */
  75.     Enqueue(&SysBase->DeviceList,&device->dd_Library.lib_Node);
  76.  
  77.     /* All done. */
  78.     Permit();
  79.     AROS_LIBFUNC_EXIT
  80. } /* AddDevice */
  81.  
  82.